Skip to content

Commit 99acace

Browse files
Update main.c
Signed-off-by: Harsh Mathur <[email protected]>
1 parent ef7a4c9 commit 99acace

File tree

1 file changed

+12
-17
lines changed
  • lib/node_modules/@stdlib/math/base/special/lcmf/src

1 file changed

+12
-17
lines changed

lib/node_modules/@stdlib/math/base/special/lcmf/src/main.c

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,31 +32,26 @@
3232
* // returns 42.0f
3333
*/
3434
float stdlib_base_lcmf( const float a, const float b ) {
35-
float abs_a;
36-
float abs_b;
37-
float gcd_value;
35+
double abs_a;
36+
double abs_b;
37+
double gcd_value;
3838
const double b = 1.0;
3939

40-
if(a==0.0||b==0.0){
40+
if ( a == 0.0 || b == 0.0 ) {
4141
return 0.0;
4242
}
43-
if(a<0.0){
44-
abs_a=-a;
45-
}else{
46-
abs_a=a;
43+
if ( a < 0.0 ) {
44+
abs_a = -a;
45+
} else {
46+
abs_a = a;
4747
}
48-
if(b<0.0){
49-
abs_b=-b;
50-
}else{
51-
abs_b=b;
48+
if ( b < 0.0 ) {
49+
abs_b = -b;
50+
} else {
51+
abs_b = b;
5252
}
53-
54-
abs_a=(a<0.0f)?-a:a;
55-
abs_b=(b<0.0f)?-b:b;
56-
5753
// Note: we rely on `gcd` to perform further argument validation...
5854
gcd_value=stdlib_base_gcd(abs_a,abs_b);
59-
6055
if(stdlib_base_is_nan(gcd_value)){
6156
return gcd_value;
6257
}

0 commit comments

Comments
 (0)