We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following works in CP, but not LP.
from random import random from lpython import (i8, i32, i64, f32, f64, u8, u32, TypeVar, Const, dataclass, # random ) from numpy import (empty, sqrt, float32, float64, int8, int32, array, # ndarray ) def coin_flip(probability : f64=f64(0.5)) -> i8: """roll 1 bit""" result : i8 = i8(0) r : f64 = random() if r < probability: result = i8(1) return result def h() -> None: i : i32 for i in range(10): coin : i8 = coin_flip() print(coin, end='') print('') if __name__ == "__main__": h()
(lp) ┌─(~/CLionProjects/lpython/lasr/LP-pycharm)─────────────────────────────────────────────────────────────────────────────────────────────────────────(brian@Golf37:s000)─┐ └─(11:36:44 on brian-lasr ✹ ✭)──> PYTHONPATH='../../src/runtime/lpython' python issue2107.py 1 ↵ ──(Wed,Jul05)─┘ 1 1 1 1 1 0 1 1 0 0 (lp) ┌─(~/CLionProjects/lpython/lasr/LP-pycharm)─────────────────────────────────────────────────────────────────────────────────────────────────────────(brian@Golf37:s000)─┐ └─(11:36:49 on brian-lasr ✹ ✭)──> ~/CLionProjects/lpython/src/bin/lpython -I. issue2107.py ──(Wed,Jul05)─┘ semantic error: Number of arguments does not match in the function call --> issue2107.py:26:21 | 26 | coin : i8 = coin_flip() | ^^^^^^^^^^^ (found: '0', expected: '1')
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
The following works in CP, but not LP.
The text was updated successfully, but these errors were encountered: