| ... | @@ -644,32 +644,41 @@ export fn fmod(x: f64, y: f64) f64 { | ... | @@ -644,32 +644,41 @@ export fn fmod(x: f64, y: f64) f64 { |
| 644 | export fn floorf(x: f32) f32 { | 644 | export fn floorf(x: f32) f32 { |
| 645 | return math.floor(x); | 645 | return math.floor(x); |
| 646 | } | 646 | } |
| 647 | | | |
| 648 | export fn ceilf(x: f32) f32 { | | |
| 649 | return math.ceil(x); | | |
| 650 | } | | |
| 651 | | | |
| 652 | export fn floor(x: f64) f64 { | 647 | export fn floor(x: f64) f64 { |
| 653 | return math.floor(x); | 648 | return math.floor(x); |
| 654 | } | 649 | } |
| | 650 | export fn floorl(x: c_longdouble) c_longdouble { |
| | 651 | if (!long_double_is_f128) { |
| | 652 | @panic("TODO implement this"); |
| | 653 | } |
| | 654 | return math.floor(x); |
| | 655 | } |
| 655 | | 656 | |
| | 657 | export fn ceilf(x: f32) f32 { |
| | 658 | return math.ceil(x); |
| | 659 | } |
| 656 | export fn ceil(x: f64) f64 { | 660 | export fn ceil(x: f64) f64 { |
| 657 | return math.ceil(x); | 661 | return math.ceil(x); |
| 658 | } | 662 | } |
| 659 | | 663 | export fn ceill(x: c_longdouble) c_longdouble { |
| 660 | export fn fmal(a: c_longdouble, b: c_longdouble, c: c_longdouble) c_longdouble { | | |
| 661 | if (!long_double_is_f128) { | 664 | if (!long_double_is_f128) { |
| 662 | @panic("TODO implement this"); | 665 | @panic("TODO implement this"); |
| 663 | } | 666 | } |
| 664 | return math.fma(c_longdouble, a, b, c); | 667 | return math.ceil(x); |
| | 668 | } |
| | 669 | |
| | 670 | export fn fmaf(a: f32, b: f32, c: f32) f32 { |
| | 671 | return math.fma(f32, a, b, c); |
| 665 | } | 672 | } |
| 666 | | 673 | |
| 667 | export fn fma(a: f64, b: f64, c: f64) f64 { | 674 | export fn fma(a: f64, b: f64, c: f64) f64 { |
| 668 | return math.fma(f64, a, b, c); | 675 | return math.fma(f64, a, b, c); |
| 669 | } | 676 | } |
| 670 | | 677 | export fn fmal(a: c_longdouble, b: c_longdouble, c: c_longdouble) c_longdouble { |
| 671 | export fn fmaf(a: f32, b: f32, c: f32) f32 { | 678 | if (!long_double_is_f128) { |
| 672 | return math.fma(f32, a, b, c); | 679 | @panic("TODO implement this"); |
| | 680 | } |
| | 681 | return math.fma(c_longdouble, a, b, c); |
| 673 | } | 682 | } |
| 674 | | 683 | |
| 675 | export fn sin(a: f64) f64 { | 684 | export fn sin(a: f64) f64 { |