Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikibooksThe Free Textbook Project
Search

Rebol Programming/modulo

From Wikibooks, open books for an open world
<Rebol Programming
This page may need to bereviewed for quality.

USAGE:

[edit |edit source]
MODULO a b

DESCRIPTION:

[edit |edit source]

Wrapper for MOD that handles errors like REMAINDER. Negligiblevalues (compared to A and B) are rounded to zero.

MODULO is a function value.

ARGUMENTS:

[edit |edit source]
  • a -- (Type: number money time)
  • b -- Absolute value will be used (Type: number money time)

(SPECIAL ATTRIBUTES)

[edit |edit source]
  • catch

SOURCE CODE

[edit |edit source]
modulo: func [    {Wrapper for MOD that handles errors like REMAINDER. Negligible^-^-values (compared to A and B) are rounded to zero.}     [catch]     a [number! money! time!]     b [number! money! time!] "Absolute value will be used"     /local r][    throw-on-error [        any [number? a b: make a b]         r: mod a abs b         either any [a - r = a r + b = b] [make r 0] [r]    ]]
Retrieved from "https://en.wikibooks.org/w/index.php?title=Rebol_Programming/modulo&oldid=3352890"
Category:

[8]ページ先頭

©2009-2025 Movatter.jp