QRandomGenerator64 Class
La classe QRandomGenerator64 consente di ottenere valori casuali a 64 bit da un generatore di numeri casuali di alta qualità e senza seme. Per saperne di più...
| Intestazione: | #include <QRandomGenerator64> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Core) target_link_libraries(mytarget PRIVATE Qt6::Core) |
| qmake: | QT += core |
| Eredita da: | QRandomGenerator |
Tipi pubblici
Funzioni pubbliche
| quint64 | generate() |
| QRandomGenerator64::result_type | operator()() |
Descrizione dettagliata
QRandomGenerator64 è una semplice classe adattatrice che si basa su QRandomGenerator, che imposta la funzione QRandomGenerator::generate64() come predefinita per operator(), anziché la funzione che restituisce valori a 32 bit. Questa classe è destinata all'uso in combinazione con gli algoritmi della libreria standard che richiedono valori a 64 bit anziché a 32 bit.
Sotto tutti gli altri aspetti, la classe rimane invariata. Per ulteriori informazioni, consultare la documentazione disponibile all’indirizzo QRandomGenerator.
Vedi anche QRandomGenerator.
Documentazione sui tipi membro
QRandomGenerator64::result_type
Un `typedef` relativo al tipo restituito dalla funzione ` operator()`. Ovvero, `quint64`.
Vedi anche operator().
Documentazione sulle funzioni membro
quint64 QRandomGenerator64::generate()
Genera un valore casuale a 64 bit e lo restituisce.
Nota sulla conversione in un intero con segno: tutti i bit restituiti da questa funzione sono casuali, quindi c'è il 50% di probabilità che il bit più significativo sia impostato. Se si desidera convertire il valore restituito in qint64 e mantenerlo positivo, è necessario mascherare il bit di segno:
Vedi anche QRandomGenerator e QRandomGenerator::generate64().
QRandomGenerator64::result_type QRandomGenerator64::operator()()
Genera un numero casuale a 64 bit e lo restituisce.
Vedi anche QRandomGenerator::generate() e QRandomGenerator::generate64().
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.