Tcl 9.1/Tk9.1 Documentation > Tcl Commands, version 9.1b0 > remquo

Tcl/Tk Applications | Tcl Commands | Tk Commands | [incr Tcl] Package Commands | SQLite3 Package Commands | TDBC Package Commands | tdbc::mysql Package Commands | tdbc::odbc Package Commands | tdbc::postgres Package Commands | tdbc::sqlite3 Package Commands | Thread Package Commands | Tcl C API | Tk C API | [incr Tcl] Package C API | TDBC Package C API

NAME

remquo — Compute floating point remainder and quadrant determinant

SYNOPSIS

package require tcl 9.1
remquo x y

DESCRIPTION

The remquo command computes the floating-point remainder of x/y, much like the remainder function. Its result is a list of two values; the first value is the remainder, and the second value is an integer containing sign and bits sufficient to determine which octant the gradient was located within.

EXAMPLE

lassign [remquo 12.3 3.89] rem quo
puts "rem=$rem, quo=$quo"
#       rem=0.6300000000000003, quo=3

SEE ALSO

expr, mathfunc

KEYWORDS

floating point
Copyright © 2025 Donal Fellows