Skip to content

Instantly share code, notes, and snippets.

@mauro3
Last active October 23, 2024 19:26
Show Gist options
  • Save mauro3/ffecc8d3801f6b09e99183632aee97d3 to your computer and use it in GitHub Desktop.
Save mauro3/ffecc8d3801f6b09e99183632aee97d3 to your computer and use it in GitHub Desktop.
HA!
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "e758e65c-6031-40b6-b1a4-7fd22ad11f5a",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(a, b) = (21.0, 37)\n"
]
}
],
"source": [
"# löse aufgabe a/b=0.567567567567567567567567567567567567\n",
"# für a und b integer\n",
"#\n",
"# Plan: b * 0.567567567567567567567567567567567567 muss ein Integer sein, test für viele b's\n",
"\n",
"c = 0.567567567567567567\n",
"\n",
"for b in (1:10000000)\n",
" a = b * c\n",
" if isapprox(a, round(a), atol= 0.000000001)\n",
" @show a, b\n",
" break\n",
" end\n",
"end"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6e192815-32db-4bf7-9d24-7be1ee6a6d15",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.10.5",
"language": "julia",
"name": "julia-1.10"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.10.5"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
[deps]
IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a"
[compat]
julia = "1.10"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment