File tree Expand file tree Collapse file tree 1 file changed +12
-17
lines changed
lib/node_modules/@stdlib/math/base/special/lcmf/src Expand file tree Collapse file tree 1 file changed +12
-17
lines changed Original file line number Diff line number Diff line change 32
32
* // returns 42.0f
33
33
*/
34
34
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 ;
38
38
const double b = 1.0 ;
39
39
40
- if ( a == 0.0 || b == 0.0 ) {
40
+ if ( a == 0.0 || b == 0.0 ) {
41
41
return 0.0 ;
42
42
}
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 ;
47
47
}
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 ;
52
52
}
53
-
54
- abs_a = (a < 0.0f )?- a :a ;
55
- abs_b = (b < 0.0f )?- b :b ;
56
-
57
53
// Note: we rely on `gcd` to perform further argument validation...
58
54
gcd_value = stdlib_base_gcd (abs_a ,abs_b );
59
-
60
55
if (stdlib_base_is_nan (gcd_value )){
61
56
return gcd_value ;
62
57
}
You can’t perform that action at this time.
0 commit comments