1
0
Fork 0
forked from fun/fun

File path refactoring. No code changes. (0.37.51)

This commit is contained in:
Johannes Findeisen 2026-01-14 04:02:24 +01:00
commit db68b30d5b
27 changed files with 0 additions and 0 deletions

38
examples/math/math_isqrt.fun Executable file
View file

@ -0,0 +1,38 @@
#!/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
*/
print("=== math isqrt demo start ===")
print("isqrt(-4) -> " + to_string(isqrt(-4))) // 0 (non-negative only)
print("isqrt(0) -> " + to_string(isqrt(0))) // 0
print("isqrt(1) -> " + to_string(isqrt(1))) // 1
print("isqrt(2) -> " + to_string(isqrt(2))) // 1
print("isqrt(3) -> " + to_string(isqrt(3))) // 1
print("isqrt(4) -> " + to_string(isqrt(4))) // 2
print("isqrt(15) -> " + to_string(isqrt(15))) // 3
print("isqrt(16) -> " + to_string(isqrt(16))) // 4
print("=== math isqrt demo end ===")
/* Expected output (values):
=== math isqrt demo start ===
isqrt(-4) -> 0
isqrt(0) -> 0
isqrt(1) -> 1
isqrt(2) -> 1
isqrt(3) -> 1
isqrt(4) -> 2
isqrt(15) -> 3
isqrt(16) -> 4
=== math isqrt demo end ===
*/