File path refactoring. No code changes. (0.37.51)
This commit is contained in:
parent
2fa8f8653e
commit
db68b30d5b
27 changed files with 0 additions and 0 deletions
32
examples/math/math_fmin_fmax.fun
Executable file
32
examples/math/math_fmin_fmax.fun
Executable file
|
|
@ -0,0 +1,32 @@
|
|||
#!/usr/bin/env fun
|
||||
|
||||
/*
|
||||
* This file is part of the Fun programming language.
|
||||
* https://fun-lang.xyz/
|
||||
*
|
||||
* Copyright 2026 Johannes Findeisen <you@hanez.org>
|
||||
* Licensed under the terms of the Apache-2.0 license.
|
||||
* https://opensource.org/license/apache-2-0
|
||||
*
|
||||
* Added: 2026-01-03
|
||||
*/
|
||||
|
||||
// Demo of fmin(x,y) / fmax(x,y) — float-aware min/max with C99 NaN handling
|
||||
|
||||
print("=== math fmin/fmax demo start ===")
|
||||
|
||||
print("fmin(3.2, 4) -> " + to_string(fmin(3.2, 4))) // 3.2
|
||||
print("fmax(3.2, 4) -> " + to_string(fmax(3.2, 4))) // 4
|
||||
print("fmin(-5, -2.5) -> " + to_string(fmin(-5, -2.5))) // -5
|
||||
print("fmax(-5, -2.5) -> " + to_string(fmax(-5, -2.5))) // -2.5
|
||||
|
||||
print("=== math fmin/fmax demo end ===")
|
||||
|
||||
/* Expected output:
|
||||
=== math fmin/fmax demo start ===
|
||||
fmin(3.2, 4) -> 3.2000000000000002
|
||||
fmax(3.2, 4) -> 4
|
||||
fmin(-5, -2.5) -> -5
|
||||
fmax(-5, -2.5) -> -2.5
|
||||
=== math fmin/fmax demo end ===
|
||||
*/
|
||||
Loading…
Add table
Add a link
Reference in a new issue