Re: Narrowing Conversion - Double to int32
- From: "Herfried K. Wagner [MVP]" <hirf-spam-me-here@xxxxxx>
- Date: Fri, 12 Jan 2007 02:03:07 +0100
"Terry" <yoo_hoo_2000@xxxxxxxxxxxxxxxxxxxxxx> schrieb:
I have x as double, hh as int32
in VBA I can perfom hh=Int(x) (narrowing conversion but disallowed in .NET)
One example in .NET is hh = System.Convert.ToInt32(x)
Could I use IConvertible and how would I code this?
Which is the better method keeping in mind that I would also be coding calculations in hours/minutes/seconds, degress/minutes/seconds, radians and logarithms. I would not want to lose too much precision in my results.
Check out 'CInt' too, which is maybe what you are looking for.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
.
- Follow-Ups:
- Re: Narrowing Conversion - Double to int32
- From: Terry
- Re: Narrowing Conversion - Double to int32
- References:
- Narrowing Conversion - Double to int32
- From: Terry
- Narrowing Conversion - Double to int32
- Prev by Date: compress and decompress byte arrays
- Next by Date: Re: Function Warning - Null Reference
- Previous by thread: Re: Narrowing Conversion - Double to int32
- Next by thread: Re: Narrowing Conversion - Double to int32
- Index(es):
Relevant Pages
|