matlab - How to tell if two numbers are really different or they are actually the same due to floating point error -


for example,

0.168033639538270 , 0.168033639538270

are 2 double type numbers 2 different calculations (some further calculations eigenvalues of matrix).

but treated different matlab (by unique or ==). how know if matlab treats them different due floating point error eps = 2.220446049250313e-16, or if different (the digits behind first 15 digits not same, matlab not display them). matlab treats 2 number same display value same, different, want know if different.

you can print formatted version of number @ required precision using sprintf, , compare 2 strings using strcmp.


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -