# tagged [point]

#### Convert Bytes to Floating Point Numbers?

Convert Bytes to Floating Point Numbers? I have a binary file that I have to parse and I'm using Python. Is there a way to take 4 bytes and convert it to a single precision floating point number?

- Modified
- 27 Jun at 15:49

#### why main method in c# is always placed inside the class but not in c++

why main method in c# is always placed inside the class but not in c++ Why we put `main()` method always inside the `class` in C# while in c++ it always placed outside of the `class`.

- Modified
- 25 Jan at 12:48

#### Rounding of float values

Rounding of float values I have the `double` value like `12.256852651` and I want to display it as `12.257` as a float number without converting it in to a string type. How can I do it in C# ?

- Modified
- 15 May at 01:18

#### Why is converting between string and float wrong?

Why is converting between string and float wrong? Please see my example below.

- Modified
- 28 Apr at 10:20

#### How to extract the decimal part from a floating point number in C?

How to extract the decimal part from a floating point number in C? How can we extract the decimal part of a floating point number and store the decimal part and the integer part into two separate inte...

- Modified
- 12 Mar at 16:59

#### How to convert float number to Binary?

How to convert float number to Binary? Can anyone please tell me how can I convert this float number: 12.25 to binary? I know how to convert the "12" but not the 0.25 Any help is much appreciated. Tha...

- Modified
- 28 Oct at 00:56

#### int main() vs void main() in C

int main() vs void main() in C In C, I know that `int main()` returns an `int` where `void main()` does not. Other than that, is there a difference between them? Is the first better than the second?

- Modified
- 28 Mar at 10:46

#### Why is floating point arithmetic in C# imprecise?

Why is floating point arithmetic in C# imprecise? Why does the following program print what it prints? Output is

- Modified
- 28 Dec at 00:13

#### C#: Convert Byte array into a float

C#: Convert Byte array into a float I have a byte array of size 4 Now I wanted to convert this source into a 4-byte float value... Can anyone tell me how to do this...

- Modified
- 9 Jan at 17:51

#### Python: Converting string into decimal number

Python: Converting string into decimal number I have a python list with strings in this format: How do I convert those strings into decimal numbers to perform arithmetic operations on the list element...

- Modified
- 20 Dec at 21:42

#### How to round to at most 2 decimal places, if necessary

How to round to at most 2 decimal places, if necessary I'd like to round at most two decimal places, but . Input: Output: How can I do this in JavaScript?

- Modified
- 5 May at 15:28

#### C# get digits from float variable

C# get digits from float variable I have a float variable and would like to get only the part after the comma, so if I have 3.14. I would like to get 14 as an integer. How can I do that?

- Modified
- 24 Jun at 20:15

#### What is the maximum float in Python?

What is the maximum float in Python? I think the maximum integer in python is available by calling `sys.maxint`. What is the maximum `float` or `long` in Python? --- [Maximum and Minimum values for in...

- Modified
- 29 Jan at 11:51

#### How do I use a decimal step value for range()?

How do I use a decimal step value for range()? How do I iterate between 0 and 1 by a step of 0.1? This says that the step argument cannot be zero:

- Modified
- 17 Jul at 04:32

#### How to limit a decimal number?

How to limit a decimal number? > [How to format a decimal](https://stackoverflow.com/questions/697977/how-to-format-a-decimal) How can I limit my decimal number so I'll get only 3 digits after the p...

- Modified
- 23 May at 12:13

#### Sending floating point number from server to client

Sending floating point number from server to client I am using socket programming. I have a stored in a variable in my server code which I want to send to the client which is waiting to receive it. Ho...

- Modified
- 31 Jul at 11:58

#### Convert Pixels to Points

Convert Pixels to Points I have a need to convert Pixels to Points in C#. I've seen some complicated explanations about the topic, but can't seem to locate a simple formula. Let's assume a standard 96...

#### How can I determine whether a 2D Point is within a Polygon?

How can I determine whether a 2D Point is within a Polygon? I'm trying to create a 2D point inside polygon algorithm, for use in hit-testing (e.g. `Polygon.contains(p:Point)`). Suggestions for effecti...

- Modified
- 1 Sep at 03:40

#### C# float to decimal conversion

C# float to decimal conversion Any smart way to convert a float like this: into a decimal (or double) without losing precision? I've tried:

- Modified
- 1 Mar at 02:48

#### Double vs. BigDecimal?

Double vs. BigDecimal? I have to calculate some floating point variables and my colleague suggest me to use `BigDecimal` instead of `double` since it will be more precise. But I want to know what it i...

- Modified
- 7 Jan at 09:14

#### Floating point comparison functions for C#

Floating point comparison functions for C# Can someone point towards (or show) some good general floating point comparison functions in C# for comparing floating point values? I want to implement func...

- Modified
- 29 Mar at 13:45

#### Is there Point3D?

Is there Point3D? Is there a built in type Point3 in .Net? Some kind of this but built in. It is not hard to implement it myself, but..

#### Best way to generate a random float in C#

Best way to generate a random float in C# What is the best way to generate a random float in C#? Update: I want random floating point numbers from float.Minvalue to float.Maxvalue. I am using these nu...

- Modified
- 9 May at 16:28

#### How to check whether input value is integer or float?

How to check whether input value is integer or float? How to check whether input value is integer or float? Suppose 312/100=3.12 Here i need check whether 3.12 is a float value or integer value, i.e.,...

- Modified
- 4 Aug at 22:12

#### Int to Decimal Conversion - Insert decimal point at specified location

Int to Decimal Conversion - Insert decimal point at specified location I have the following int 7122960 I need to convert it to 71229.60 Any ideas on how to convert the int into a decimal and insert t...

- Modified
- 6 Apr at 14:4