View source code
							
							
						
								Display the source code in std/math/remainder.d from which this
								page was generated on github.
							
						
							Report a bug
							
						
								If you spot a problem with this page, click here to create a
								Bugzilla issue.
							
						
							
								Improve this page
							
							
					
								Quickly fork, edit online, and submit a pull request for this page.
								Requires a signed-in GitHub account. This works well for small changes.
								If you'd like to make larger changes you may want to consider using
								local clone.
							
						Function std.math.remainder.remainder
Calculate the remainder x REM y, following IEC 60559.
						
				real remainder
				(
				
				  real x,
				
				  real y
				
				) nothrow @nogc @trusted;
						
					
				REM is the value of x - y * n, where n is the integer nearest the exact value of x / y. If |n - x / y| == 0.5, n is even. If the result is zero, it has the same sign as x. Otherwise, the sign of the result is the sign of x / y. Precision mode has no effect on the remainder functions.
 remquo returns n in the parameter n.
| x | y | remainder(x, y) | n | invalid? | 
|---|---|---|---|---|
| ±0.0 | not 0.0 | ±0.0 | 0.0 | no | 
| ±∞ | anything | -NAN | ? | yes | 
| anything | ±0.0 | ±NAN | ? | yes | 
| != ±∞ | ±∞ | x | ? | no | 
Example
import stdExample
import stdAuthors
Walter Bright, Don Clugston, Conversion of CEPHES math library to D by Iain Buclaw and David Nadlinger
License
					Copyright © 1999-2024 by the D Language Foundation | Page generated by ddox.