DSPRelated.com
Forums

approximation of numbers

Started by sadek June 13, 2010
How we turn for example 2.0000000000003 into 2 only?
Not sure if this is the perfect answer but you can try changing the data type from a double to a uint (unsigned integer)

Cheers,

How we turn for example 2.0000000000003 into 2 only?
>
 
Dear  Sir,
 
You should use ROUND function
  Round towards nearest integer.
    ROUND(X) rounds the elements of X to the nearest integers
 
 
I hope this help
 
Regards,
Ibrahim nasir

--- On Mon, 7/5/10, c...@gmail.com wrote:
From: c...@gmail.com
Subject: [matlab] Re: approximation of numbers
To: m...
Date: Monday, July 5, 2010, 8:15 PM
 

Not sure if this is the perfect answer but you can try changing the data type from a double to a uint (unsigned integer)

Cheers,

How we turn for example 2.0000000000003 into 2 only?
>
Use vap or digit 5 command like vap('sqrt(2)'.2)

On 7/5/10, c...@gmail.com wrote:
> Not sure if this is the perfect answer but you can try changing the data
> type from a double to a uint (unsigned integer)
>
> Cheers,
>
> How we turn for example 2.0000000000003 into 2 only?
>

--
Mohd Muqeem
B.Tech.(Electronics)
Dept. of Electronics Engineering
Zakir Hussain College Of Engg. & Tech.
Aligarh Muslim University
Uttar pradesh
India.
Mob. +919808189882 , +919045130940