Skip to content

Modern Math SetRoundingMode

Paul Squires edited this page Oct 19, 2026 · 5 revisions

Home › Math Library › Math Library › SetRoundingMode

SetRoundingMode

Sets the direction floating-point results are rounded in; returns true on success.

Syntax

SetRoundingMode( m )

Examples

#import "std/numeric"
using numeric

'' PROCESS-WIDE AND STICKY: it changes every later floating-point
'' operation in the program, not just the next one. Put it back.
dim as int32 was = GetRoundingMode( )

print SetRoundingMode( ROUND_TOWARD_ZERO )       '' true
print GetRoundingMode( ) = ROUND_TOWARD_ZERO     '' -1 (true)

SetRoundingMode( was )
print GetRoundingMode( ) = was                   '' -1 (true)

Library: Math Library
Category: Math Library
Documented under: Nothing Becomes A Keyword

Clone this wiki locally