|
by: Nicolas |
last post by:
Why does for the same code I got different result
the VB code gave me what I want why not the csharp?
Thank you for your help...
CSHARP CODE
int sx, sy;
double sdegrees;
sdegrees = (90 - (5/15) * 90) * (System.Math.PI / 180);
|
by: ng_mr |
last post by:
No, not a question about "banker's rounding" or whatever it's called.
I want to round a double to the nearest 100th, so I perform the
following:
// original is a double
double result = Math.Round( original, 2 );
But I'm not happy with the results. E.g. if original is
|
by: nvphu |
last post by:
I need to use the constant M_PI. So, I insert the directive # include <math.h>.
However when compiled, there are errors : M_PI undeclared identifier.
Second, I can not use the function round(double x).
Anyone could be so kind to help me.
Thanks a lot
|
by: Mitchell Vincent |
last post by:
Just making sure I'm not missing the boat here, but are there any
special routines for doing currency math (fixed precision stuff) in .NET?
The wonderful problems of doing math on decimals tend to shine when
writing accounting software :-)
How are others dealing with this?
--
- Mitchell Vincent
|
by: Chris Davoli |
last post by:
The folllowing will round to 526, but it should round to 527. It works
correctly for all other numbers, except for this one. Does anybody know of a
bug in Math.Round?
Dim ldecWater As Decimal = 526.5
CType(Math.Round(ldecWater, 0), String)
--
Chris Davoli
|
|
by: David Coleman |
last post by:
I am running VS 2003 and have applied SP1. (On WinXP SP2, .Net 1.1)
In the Command Window I get the following
? Math.Round(0.715, 2)
0.72
? Math.Round(0.725, 2)
0.72
? Math.Round(0.735, 2)
0.74
|
by: Altman |
last post by:
OK I was having rounding problems before and I didn't realize that
their was a third parameter in the round function that would tell it if
it a 5 to round up. I thought adding this would fix the problem but it
didn't. I have VS 2005 and I am using vb.net try rounding the number
4.935 to 2 decimals:
What I am seeing is the following:
Math.Round(4.935, 2, MidpointRounding.AwayFromZero) 'Result is 4.93
Math.Round(4.935, 2,...
|
by: Zeng |
last post by:
Math.Round has good behavior as following:
Math.Round(3.45, 1); //Returns 3.4. The last '5' is thrown away because 4 is
even
Math.Round(3.75, 1); //Returns 3.8. The last '5' is used because '7' is odd
However, if format.NumberDecimalDigits is 1
decimal d = 3.45M;
d.ToString( "F", format ); //Return 3.5 - this is different from Math.Round;
|
by: =?Utf-8?B?UmVuZQ==?= |
last post by:
Hello everyone
I have a problem with Math.Round, it´s ocurring some strange:
Math.Round(12.985) = 12.98, it´s wrong. It should be: 12.99
Why?? What is the problem?
Help ME !!!!
|
by: DaiOz |
last post by:
Hi guys im doing a course which includes some JavaScript and I need help with the following question please,
The code I have so far is below but I don't think its right please help as I need to complete this part to move onto the next.
<HTML>
<HEAD>
<TITLE>M150 TMA 5 : Programming : Task 1 - Testing Math.random()</TITLE>
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|