« first day (2229 days earlier)      last day (848 days later) » 

08:39
Hi, I don't understand why any int (a, b, c, d) can't reproduce the original float value?
When I dump memory in VS I see int and float have same memory contents: MY_FLOAT have same dump with int a = 0x3f9e0610;
But casting a back to float: std::cout << "Value: " << (float)a << std::endl; I don't get exact value as I was expected. Where things are broken?
Here:
(float&)BYTE_ARRAY[0] is perfectly equivalent with (float)a
I really can't figure it out what is the lose of prefision/error here.
When you cast an int to a float it converts the numerical value
*((float*)&a) is more similar to (float&)BYTE_ARRAY[0] than (float)a
09:21
@PeterT Thank you very much, I will make multiple tests to understand.
But this works correctly ((float)&a)
09:45
int a = 0x3f9e0610;
int x = 0x3f9e02C0;

But why cast by converts the numerical value change just the 16bit?
06 10 is 02 C0
in x
via
float e = (float)a;
and
float f = (float&)(((float)&a));
is int a
x is value of converts the numerical value from direct int to float cast
I don't understand the question, I don't see anything 16-bit related
09:58
/// Case 1: Value float MY_FLOAT = 1.23456F is represented in memory as 10 06 9e 3f
/// Case 2: Value int a = 0x3f9e0610 is represented in memory as 10 06 9e 3f
/// Case 3: Value float e = (float)a = 1.06732e+009 is represented in memory as c0 02 9e 3f
/// Case 4: Value float f = (float&)(*((float*)&a)) = 1.23456F is represented in memory as 10 06 9e 3f
Why for case 3 casting to it's numerical value match just 9e 3f
This are 16 bits what I have mentioned, I try to understand this
I try to understand if memory value 0x3f9e0610 is same as 1.23456F why casting normally with (float) does not return back same memory value as (float&)(((float)&a))
Q:" it converts the numerical value" (just most significative 16bits)?
Or is just a coincidence
This 9e 3f
10:14
no it's converting the whole number, it's not a coincidence, it's just because of the bit-representation of float numbers
 
4 hours later…
14:30
Is possible in C++ to emulate Voldemort types (wiki.dlang.org/Voldemort_types)
I try to create a buffer array and my function can return variadic type with the same name
I don't want to use templates
With no success, I try to implement a buffer array and push any object to it via push
on pop out a element I don't want to explicitly say it's type and this type somehow to be solved by the calee not via a template method argument.
I think I need somehow to re-implement boost::any but I can't use boost framework as I develop for embedded systems
and you're using a version too old to use std::any ?
std is not alowed also
System is ARM and just NEON extension no std no other stuff
14:47
What? ARM has the C++ stdlib
what compiler/OS?
well he said "not allowed" and not "not available"
so it sounds like the typical "someone once made a problem with this, so we'll just ban it for this code-base" stuff
That just sounds dumb
I get banning unstable features, but banning the entire stdlib because of things like that is silly
I could see requiring using custom allocators and thus a set of custom aliases
it's the embedded world go easy on them. Be glad if they already discovered version control systems, that's not a given there.
if my clients are anything to go by... that's not just an embedded problem
15:08
This is how it is... Custom OS on a core, custom scheduler on another, everything forbidden for use of std or other extension frameforks, because of RTTI, because exception handling (try/catch) everything is forbidden. Some functions are using dirrectly assembly for sqrt from NEON which is done HW (__asm()), std sqrt or math stuff cannot be resolved correctly to the fastest thing. Everything what consume runtime is bad, we talk about component execution under 1ms usually 500 microseconds.
I try to design a little framework to ease buffering not like is now reading dirrectly from a memory location and dereferencing data to a expected datatype, I am trying to somehow serialize object to simplify calls and return values.
There are a lot of frameworks like autosar like qnx for buffering and I understand these buffering methods (publisher / subscriber) but these frameworks generate the "glue code" buffers automatically and functions and everyting
These virtual busses.
 
1 hour later…
16:16
ByteArray::pop()::ObjectPlaceholder::operator B()':
<source>:67:47: error: invalid use of non-static data member 'ByteArray::m_ByteArray'
Via operator overloading makes me to create a static buffer...
Idk
This auto...
@LXSoft you can use most of the stdlib without RAII

« first day (2229 days earlier)      last day (848 days later) »