Is it possible to get the memory address of a variable in C #.
What I'm trying to do is very simple. I want to declare variables of type Double, Float, Decimal and assign a value of 1.1 to each of these variables. Then I would like to see how these values are represented in memory. I need to get the memory address of a variable to see how it is stored in memory. When I have a memory address I plan to put a breakpoint in the code and use Debug -> Windows -> Memory in the visual studio to see how the numbers are stored in memory.
Greetings
, # . , , 18 #, .
, , , , , . ; wikipedia msdn , .
1- , 96- , 96- , . 10, 0 28.
. http://msdn.microsoft.com/en-us/library/system.decimal.aspx.
- , 11 , -1022 +1023, 52 , "1". 52 .
http://en.wikipedia.org/wiki/Double_precision : http://blogs.msdn.com/ericlippert/archive/tags/Floating+Point+Arithmetic/default.aspx
, : , 8 , 23 . . http://en.wikipedia.org/wiki/Single_precision_floating-point_format.
, , BitConverter, . #, , , .
, BitConverter , , &varname, .
&varname
tyranid, , - . , ILdasm , , , #. #: -
double d1 = 21.1; decimal d2 = 22.1M; float d3 = 21.1F;
IL- ILDasm, , # : -
//000012: double d1 = 21.1; IL_0001: ldc.r8 21.100000000000001 .............. //000013: decimal d2 = 22.1M; IL_000b: ldc.i4 0xdd ............... //000014: float d3 = 21.1F; IL_001a: ldc.r4 21.1
, .
Source: https://habr.com/ru/post/1740099/More articles:Notification framework for java - javaNHibernate stored procedure problem - nhibernateWhat happens first? Does anyone know how the Apache server will handle this request? - securitySetting a registry value based on a dialog in a visual studio setup project - visual-studio-2008Why does PHP5 SQLite PDO fail silently when connecting a database? - phpесли условие в диаграмме класса uml? - classчто лучше всего подходит для конфигурации Hibernate- Spring для нескольких отношений с базой данных? - springUIButton Disclosure Indicator - iphoneGood suggestions for learning OOP PHP - oopDOM: how to import nodes and provide them with another namespace prefix - domAll Articles