~ ( x y epsilon -- ? )

Factor handbook » The language » Numbers » Mathematical functions » Arithmetic functions

Factor handbook » The language » Numbers » Mathematical functions » Arithmetic functions

Prev: | round ( x -- y ) |

Vocabulary

math.functions

Inputs

Outputs

Word description

Tests if x and y are approximately equal to each other. There are three possible comparison tests, chosen based on the sign of epsilon:

Definition

math.functions

Inputs

x | a real |

y | a real |

epsilon | a real |

Outputs

? | a boolean |

Word description

Tests if x and y are approximately equal to each other. There are three possible comparison tests, chosen based on the sign of epsilon:

• | epsilon is zero: exact comparison. |

• | epsilon is positive: absolute distance test. |

• | epsilon is negative: relative distance test. |

Definition

This documentation was generated offline from a
`load-all`

image. If you want, you can also
browse the documentation from within the UI developer tools. See
the Factor website
for more information.

Factor 0.99 x86.64 (2173, heads/master-f3ee5c5979, Sep 18 2022 13:17:51)