mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Module refactoring
This commit is contained in:
19
submodules/RMIntro/Sources/core/rngs.c
Normal file
19
submodules/RMIntro/Sources/core/rngs.c
Normal file
@@ -0,0 +1,19 @@
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <stdlib.h>
|
||||
#include "rngs.h"
|
||||
|
||||
float frand(float from, float to)
|
||||
{
|
||||
return (float)(((double)random()/RAND_MAX)*(to-from)+from);
|
||||
}
|
||||
|
||||
int irand(int from, int to)
|
||||
{
|
||||
return (int)(((double)random()/RAND_MAX)*(to-from+1)+from);
|
||||
}
|
||||
|
||||
int signrand()
|
||||
{
|
||||
return irand(0, 1)*2-1;
|
||||
}
|
||||
Reference in New Issue
Block a user