SagaSaga
Standard Library

Std.Float

Floating-point conversion and arithmetic operations.

Functions

trunc

fun trunc : (x: Float) -> Int

Truncates a float towards zero, returning an integer.

round

fun round : (x: Float) -> Int

Rounds a float to the nearest integer.

floor

fun floor : (x: Float) -> Int

Rounds a float down to the nearest integer.

ceil

fun ceil : (x: Float) -> Int

Rounds a float up to the nearest integer.

parse

fun parse : (s: String) -> Maybe Float

Parses a string as a float. Returns Nothing if the string is not a valid float.

add

fun add : Float -> Float -> Float

Adds two floats.

sub

fun sub : Float -> Float -> Float

Subtracts the second float from the first.

mul

fun mul : Float -> Float -> Float

Multiplies two floats.

div

fun div : Float -> Float -> Float

Divides the first float by the second.

mod

fun mod : Float -> Float -> Float

Returns the remainder of dividing the first float by the second.