Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

need helps to explain C++ codes

Not open for further replies.


Junior Member level 2
Jan 4, 2006
Reaction score
Trophy points
Activity points
codes in c++

due to i have no knowledge about c++ at all, can anyone help me to translate below code into c languages?

for (inter=0; inter<6; inter++) {
start = ldtogfxp ( (long double) (inter ? -(1 << (inter - 1)) : 0) );
end = ldtogfxp ( (long double) ( - (1 << inter)) ) + 1.0;
aInterval[inter].intWidth = (end - start) / LUTsize;
delta = gfxptold (aInterval[inter].intWidth);


attached is the header files that related with this code.

c++ cpdes

That's not C++ - it looks like ANSI C to me. As a C programmer what part don't you understand.

explain c++

actually, i would like to seek the answer for 'delta' when 'inter = 1'. as a c programmer, i know how the system computes the bitwise left shift operation ( 1 << inter ...) in 'start' and 'end' functions. the only thing that make me confuse is what is the purpose of term 'ldtogfxp' which stated in both functions. once i know how it works, then i think i should be able to understand how the delta value being computed. hope you can share with me some lights. thanks.

explain c++

If you look at the header file you'll see that 'ldtogfxp' is a function that converts a 'long double' to a 'gFXP' type. gFXP is typedefed as a 'long double'. So what the function is doing is converting a 'long double' to a 'long double'. Presumably 'gFXP' is encoded in some way- the header file indicates it's a 'guarded LNS'. From the name I'd guess that maybe it's a fixed point value. So you really have no way of knowing unless you have the source code to the 'ldtogfxp' function or some documentatin that explains the data types.

thanks. i had now got the result of 'delta'.

Not open for further replies.

Part and Inventory Search

Welcome to