Solved

# Reminder of a Floating Point to Floating Point Devision Divistion. Is it Possible?

Posted on 2008-06-22
714 Views
Hi,

I'm translating a VB.NET Code to Delphi (Pascal). In this code, MOD operator used to get the reminder of a floating point division. I could not understand what a reminder of a floating point division mean and How it's possible to get a reminder of such division.

Here is the code I'm got in stuck with:
If angle Mod Math.PI = Math.PI / 2D Then Return Single.PositiveInfinity

In pascal there is DIV and MOD operator but they both could only used to get the reminder of Integer division. For floating point division, / Operator could be used. But there is no operator for calculating the reminder of a floating point division.

So, Does it really possible to get the reminder of floating point division? If so, how could I translate this code to pascal?

Second What "2D" mean? Does it mean that it's a Double Number?

Private Function GetAngularCoefficient(ByVal segment As PointF()) As Single
If segment.Length <> 2 Then Throw New ArgumentException("Parameter must be of 2 items", "segment")
Dim U As PointF = segment(0)
Dim V As PointF = segment(1)
Dim angle As Double = GetAngularCoefficientRads(U, V)

If angle Mod Math.PI = Math.PI / 2D Then Return Single.PositiveInfinity
If angle Mod Math.PI = -Math.PI / 2D Then Return Single.NegativeInfinity
Return CSng(Math.Tan(angle))
End Function
0
Question by:ShimaAlavi
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 2

Author Comment

ID: 21841292
I'm not sure. But As I understand from searches on the internet, MOD operator return reminder of Integer division and not floating-point division.
0

Accepted Solution

ShimaAlavi earned 0 total points
ID: 21841310
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

### Suggested Solutions

Firemonkey Tcameracomponent resultion 1 48
VB.net Filesystem watcher not working 5 58
"lblTime is not declared" 3 65
.Net remove carriage returns, line feeds and tabbs 5 36
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
###### Suggested Courses
Course of the Month3 days, 11 hours left to enroll