Go to advanced search

by jahboater
Mon Nov 22, 2021 12:10 pm
Forum: General discussion
Topic: Linux vs Windows
Replies: 116
Views: 3968

Re: Linux vs Windows

My impression form watching many presentations from various C++ conferences these last few years was that MS now has a team working on their C/C++ compilers that are very keen on keeping up with the standards. They have guys on the standards committee. Yes, that's good. I did say I thought the situ...
by jahboater
Mon Nov 22, 2021 12:06 pm
Forum: General discussion
Topic: Linux vs Windows
Replies: 116
Views: 3968

Re: Linux vs Windows

Heater wrote:
Mon Nov 22, 2021 11:59 am
I have no idea if the ARM compiler produces better or more performant code. I would wager though that the difference is not significant enough for most to require.
It's based on the free LLVM compiler.
by jahboater
Mon Nov 22, 2021 10:50 am
Forum: General discussion
Topic: Linux vs Windows
Replies: 116
Views: 3968

Re: Linux vs Windows

You only pay MS for VS if you're over 6 employees. But ARM don't offer their system FOC for small companies. You can develop for either platform with free tools, but the cost savings are soon wiped out by costs of supporting yourself. My experience is that the free tools work rather better. I have ...
by jahboater
Mon Nov 22, 2021 10:29 am
Forum: C/C++
Topic: Why no warning?
Replies: 46
Views: 2101

Re: Why no warning?

I would be interested in comments, and possible additions . . . ! I have a short list that is always in use for every build: -Wall -Wextra -Wconversion -Wuninitialized -Wunused -Wcast-qual -Wcast-align -Werror and for a "lint" like static analysis sort of check I add these too: LINT = -O3...
by jahboater
Mon Nov 22, 2021 4:15 am
Forum: General discussion
Topic: Linux vs Windows
Replies: 116
Views: 3968

Re: Linux vs Windows

RISC-OS
https://www.riscosopen.org/content/
The original OS for ARM

Not my idea of a fertile programming environment compared to Linux.
Great if you like ARM 32 assembler (graphics available directly via OS system calls).
You do get a compiler, but its GCC 4 ....
Unlikely to be ported to Aarch64.
by jahboater
Mon Nov 22, 2021 1:49 am
Forum: General discussion
Topic: Linux vs Windows
Replies: 116
Views: 3968

Re: Linux vs Windows

I don't see this. What's the difference between downloading Visual Studio and downloading all the Linux development tools for whatever platform you are on. I don't download the Linux development tools (I need). They are included with the OS and ready to use, as is the documentation. I may be out of...
by jahboater
Sun Nov 21, 2021 5:06 pm
Forum: General discussion
Topic: Linux vs Windows
Replies: 116
Views: 3968

Re: Linux vs Windows

which OS is best for programming? As noted above its a personal choice. However, Windows comes with nothing as standard for the programmer, no compilers no debuggers, no profilers nothing. Microsoft presumable expect that most Windows users are not programmers, and that's likely true. Perhaps also ...
by jahboater
Sun Nov 21, 2021 4:57 pm
Forum: C/C++
Topic: Why no warning?
Replies: 46
Views: 2101

Re: Why no warning?

I'm not convinced that having to think about what one writes and having to explicitly cast types will reduce safety. I simply meant that once the cast is in place, the code will never checked again. Also its a refuge for lazy programmers who cant be bothered to get the types right ... Yes auto does...
by jahboater
Sun Nov 21, 2021 2:34 pm
Forum: C/C++
Topic: Why no warning?
Replies: 46
Views: 2101

Re: Why no warning?

A strongly typed language can see all such attempted type coercion's and reject them with error at compile time. The language can be designed so as to require the programmer write type casting wherever he actually desires such conversions. Yes, that is true. But would you not soon get fed up with c...
by jahboater
Sun Nov 21, 2021 2:14 pm
Forum: C/C++
Topic: Why no warning?
Replies: 46
Views: 2101

Re: Why no warning?

In practice I have never seen that exception being tested in any C project I have worked on. Nor any other floating point exception. Its the modern way of doing things. errno for arithmetic is being used less and less, if not actually deprecated. By the way, that is just using the "sticky"...
by jahboater
Sun Nov 21, 2021 11:49 am
Forum: C/C++
Topic: Why no warning?
Replies: 46
Views: 2101

Re: Why no warning?

If the value of the integral part cannot be represented by the integer type, the behavior is undefined. In practice, on any computer supporting IEEE floating-point arithmetic, this is dealt with safely at run-time by checking the FE_INVALID exception flag. if( fetestexcept(FE_INVALID) ) printf(&quo...
by jahboater
Sun Nov 21, 2021 11:16 am
Forum: C/C++
Topic: Why no warning?
Replies: 46
Views: 2101

Re: Why no warning?

Conversion to or from an integer type, as in the OP's example, is undefined behaviour if it produces a value outside the range that cannot be represented in the target type at run time. So for example passing 10e30 to the example function would be undefined behaviour as that is too big to fit in an...
by jahboater
Sat Nov 20, 2021 8:05 pm
Forum: C/C++
Topic: Why no warning?
Replies: 46
Views: 2101

Re: Why no warning?

Glad to see C compilers are improving in this area. A few years ago, GCC had a push to improve its diagnostics, because LLVM was considered better in this respect. I think they are quite good now, a nice layout and colours to highlight things, and sometimes helpful suggestions for the correct code....
by jahboater
Sat Nov 20, 2021 7:44 pm
Forum: C/C++
Topic: Why no warning?
Replies: 46
Views: 2101

Re: Why no warning?

The compiler (GCC 11.2) produces all these dire warnings for this program: try.c: In function ‘main’: try.c:26:27: error: implicit conversion from ‘float’ to ‘double’ when passing argument to function [-Werror=double-promotion] 26 | printf("C. org = %g, ", x); | ^ try.c:27:18: error: conve...
by jahboater
Sat Nov 20, 2021 6:33 pm
Forum: General
Topic: True Random Number Genetator
Replies: 23
Views: 913

Re: True Random Number Genetator

scruss wrote:
Sat Nov 20, 2021 6:22 pm
Won't you also lose uniformity? Floating point values aren't evenly spaced at all
Hmmm - good point.
Its a commonly suggested method though.
Do you know of a more correct formula that could do such a thing?
by jahboater
Sat Nov 20, 2021 12:45 pm
Forum: Français
Topic: fréquence arm de mon raspberry pi
Replies: 1
Views: 184

Re: fréquence arm de mon raspberry pi

Yes its normal. Its an old comment from the first Pi models. If you have a Pi4 then it will be running at 1500MHz or 1800MHz under load, depending on the Pi4 version and the OS version (see arm_boost=1). (and if you need extra speed, then its easy to overclock to 2100MHz or more depending on your co...
by jahboater
Fri Nov 19, 2021 8:46 pm
Forum: General
Topic: True Random Number Genetator
Replies: 23
Views: 913

Re: True Random Number Genetator

Do all the “good” 64bit P S RNGs retain their properties when one uses modulus to reduce the range? I'm not sure what you mean by PSRNG? I believe the more sophisticated PRNG's do not have the problem. I use this instead of a simple modulus to convert a 64-bit unsigned integer to a 64-bit double in...
by jahboater
Fri Nov 19, 2021 5:39 pm
Forum: General
Topic: True Random Number Genetator
Replies: 23
Views: 913

Re: True Random Number Genetator

I ran a gigabyte of os.urandom() data through rngtest and it gave me 388 fails / 429108 passes. A gigabyte of /dev/urandom (= good enough for crypto) data on my Linux box gave 317 fails/ 429179 passes. Interesting, I didn't know about rngtest (FIPS 140-2 tests). Presumably tests for suitability for...
by jahboater
Fri Nov 19, 2021 1:01 am
Forum: General
Topic: True Random Number Genetator
Replies: 23
Views: 913

Re: True Random Number Genetator

Here is the opposite, the output of a hi-res clock passed through the byte swap instruction and converted to a float between 0 and 1. Nothing random about it at all, but it looks random to the human reader and being a monotonic clock, the sequence doesn't repeat. 0.816067340420766 0.837384107159658 ...
by jahboater
Fri Nov 19, 2021 12:42 am
Forum: Troubleshooting
Topic: Pi4/8Gb Latest 3Gbyte BULLSEYE-32bit Image - Does Not Sync Time/Date At Boot-Up
Replies: 11
Views: 602

Re: Pi4/8Gb Latest 3Gbyte BULLSEYE-32bit Image - Does Not Sync Time/Date At Boot-Up

My 32-bit version of bullseye works perfectly too: pi@pi32:~ $ timedatectl Local time: Fri 2021-11-19 00:38:35 GMT Universal time: Fri 2021-11-19 00:38:35 UTC RTC time: n/a Time zone: Europe/London (GMT, +0000) System clock synchronized: yes NTP service: active RTC in local TZ: no pi@pi32:~ $ I susp...
by jahboater
Thu Nov 18, 2021 11:06 pm
Forum: Troubleshooting
Topic: Pi4/8Gb Latest 3Gbyte BULLSEYE-32bit Image - Does Not Sync Time/Date At Boot-Up
Replies: 11
Views: 602

Re: Pi4/8Gb Latest 3Gbyte BULLSEYE Image - Cannot Sync Time/Date At Boot-Up

For me Bullseye is broken and until the time can be synchronized it cannot be updated. Someone somewhere out there must know what it going wrong. I cannot believe its something I or my environment is adding. Its always worked for me with bullseye and I never tweak anything. pi@pi64:~ $ timedatectl ...
by jahboater
Thu Nov 18, 2021 9:29 pm
Forum: General
Topic: True Random Number Genetator
Replies: 23
Views: 913

Re: True Random Number Genetator

It looks like Pierre L’Ecuyer's LCG above with some other bells and whistles. Its Donald Knuth's 64-bit LCG minus the proper addend 6364136223846793005 * state + 1442695040888963407 Check the multiplier 636413 ..... Both Knuth and L’Ecuyer are highly respected mathematicians and computer scientists...
by jahboater
Thu Nov 18, 2021 5:15 pm
Forum: General
Topic: True Random Number Genetator
Replies: 23
Views: 913

Re: True Random Number Genetator

What I need is to avoid repetition, That's called the PRNG's "period". The two 64-bit LCG's I posted above are both "full period" and that means they go for 2^64 numbers before repeating themselves (that is 18446744073709551615 numbers!). There are others such as the Mersenne Tw...
by jahboater
Thu Nov 18, 2021 2:28 am
Forum: General
Topic: True Random Number Genetator
Replies: 23
Views: 913

Re: True Random Number Genetator

Is there any strong reason why you particularly need a "true" random number generator? I mean, if you needed a "true" RNG why look at rand() ? Otherwise there are many pseudo random number generators that would run on a Pico. Here are a couple of better LCG's that should be fast ...
by jahboater
Wed Nov 17, 2021 10:53 am
Forum: Français
Topic: Geany : compiler main.c: undefined reference to `vRadio_Init'
Replies: 1
Views: 147

Re: Geany : compiler main.c: undefined reference to `vRadio_Init'

You link with wiringPi ( the command line option -lwiringPi ) but there is no library reference for the vRadio stuff, so all the undefined references are to be expected.
Take a look at the vRadio documentation and see what its library is called.

Go to advanced search