{"action":"created","issue":{"url":"https://api.github.com/repos/red/red/issues/2433","repository_url":"https://api.github.com/repos/red/red","labels_url":"https://api.github.com/repos/red/red/issues/2433/labels{/name}","comments_url":"https://api.github.com/repos/red/red/issues/2433/comments","events_url":"https://api.github.com/repos/red/red/issues/2433/events","html_url":"https://github.com/red/red/issues/2433","id":206794603,"node_id":"MDU6SXNzdWUyMDY3OTQ2MDM=","number":2433,"title":"Use % and %% for modulo and / and // for division","user":{"login":"PeterWAWood","id":697434,"node_id":"MDQ6VXNlcjY5NzQzNA==","avatar_url":"https://avatars3.githubusercontent.com/u/697434?v=4","gravatar_id":"","url":"https://api.github.com/users/PeterWAWood","html_url":"https://github.com/PeterWAWood","followers_url":"https://api.github.com/users/PeterWAWood/followers","following_url":"https://api.github.com/users/PeterWAWood/following{/other_user}","gists_url":"https://api.github.com/users/PeterWAWood/gists{/gist_id}","starred_url":"https://api.github.com/users/PeterWAWood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PeterWAWood/subscriptions","organizations_url":"https://api.github.com/users/PeterWAWood/orgs","repos_url":"https://api.github.com/users/PeterWAWood/repos","events_url":"https://api.github.com/users/PeterWAWood/events{/privacy}","received_events_url":"https://api.github.com/users/PeterWAWood/received_events","type":"User","site_admin":false},"labels":[{"id":119409,"node_id":"MDU6TGFiZWwxMTk0MDk=","url":"https://api.github.com/repos/red/red/labels/status.reviewed","name":"status.reviewed","color":"d7e102","default":false},{"id":910532277,"node_id":"MDU6TGFiZWw5MTA1MzIyNzc=","url":"https://api.github.com/repos/red/red/labels/type.task.wish","name":"type.task.wish","color":"fef2c0","default":false}],"state":"open","locked":false,"assignee":{"login":"dockimbel","id":411393,"node_id":"MDQ6VXNlcjQxMTM5Mw==","avatar_url":"https://avatars1.githubusercontent.com/u/411393?v=4","gravatar_id":"","url":"https://api.github.com/users/dockimbel","html_url":"https://github.com/dockimbel","followers_url":"https://api.github.com/users/dockimbel/followers","following_url":"https://api.github.com/users/dockimbel/following{/other_user}","gists_url":"https://api.github.com/users/dockimbel/gists{/gist_id}","starred_url":"https://api.github.com/users/dockimbel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dockimbel/subscriptions","organizations_url":"https://api.github.com/users/dockimbel/orgs","repos_url":"https://api.github.com/users/dockimbel/repos","events_url":"https://api.github.com/users/dockimbel/events{/privacy}","received_events_url":"https://api.github.com/users/dockimbel/received_events","type":"User","site_admin":false},"assignees":[{"login":"dockimbel","id":411393,"node_id":"MDQ6VXNlcjQxMTM5Mw==","avatar_url":"https://avatars1.githubusercontent.com/u/411393?v=4","gravatar_id":"","url":"https://api.github.com/users/dockimbel","html_url":"https://github.com/dockimbel","followers_url":"https://api.github.com/users/dockimbel/followers","following_url":"https://api.github.com/users/dockimbel/following{/other_user}","gists_url":"https://api.github.com/users/dockimbel/gists{/gist_id}","starred_url":"https://api.github.com/users/dockimbel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dockimbel/subscriptions","organizations_url":"https://api.github.com/users/dockimbel/orgs","repos_url":"https://api.github.com/users/dockimbel/repos","events_url":"https://api.github.com/users/dockimbel/events{/privacy}","received_events_url":"https://api.github.com/users/dockimbel/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/red/red/milestones/24","html_url":"https://github.com/red/red/milestone/24","labels_url":"https://api.github.com/repos/red/red/milestones/24/labels","id":2484052,"node_id":"MDk6TWlsZXN0b25lMjQ4NDA1Mg==","number":24,"title":"0.6.4","description":"","creator":{"login":"dockimbel","id":411393,"node_id":"MDQ6VXNlcjQxMTM5Mw==","avatar_url":"https://avatars1.githubusercontent.com/u/411393?v=4","gravatar_id":"","url":"https://api.github.com/users/dockimbel","html_url":"https://github.com/dockimbel","followers_url":"https://api.github.com/users/dockimbel/followers","following_url":"https://api.github.com/users/dockimbel/following{/other_user}","gists_url":"https://api.github.com/users/dockimbel/gists{/gist_id}","starred_url":"https://api.github.com/users/dockimbel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dockimbel/subscriptions","organizations_url":"https://api.github.com/users/dockimbel/orgs","repos_url":"https://api.github.com/users/dockimbel/repos","events_url":"https://api.github.com/users/dockimbel/events{/privacy}","received_events_url":"https://api.github.com/users/dockimbel/received_events","type":"User","site_admin":false},"open_issues":33,"closed_issues":149,"state":"open","created_at":"2017-04-26T15:58:30Z","updated_at":"2018-05-19T14:29:44Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2017-02-10T13:21:45Z","updated_at":"2018-06-06T07:10:23Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"It is suggested that the symbols ```%``` and ```%%``` be used as infix modulo operators and ```/``` and ```//``` be used as infix division operators.\r\n\r\nThe ```/``` operator will perform non-integer division of numbers. In general, it will return a ```float!``` number.\r\n\r\nThe ```//``` operator will perform an integer division, both the dividend and the divisor must be integer, an integer is returned. The result is calculated as the floor of the dividend divided by the divisor.\r\n\r\nThe calculation of modulo is a complex topic. The paper \"The Euclidean Definition of the Functions div and mod\" by Raymond T. Boute, University of Nijmegen, ACM Transactions on Programming Languages and Systems, Vol 14, No. 2, April 1992 highlights the complexity.\r\n\r\nThe abstract of the paper provides a good summary:\r\n\r\n _\"The definitions of the functions div and mod in the computer science literature and in programming languages are either similar to the Algol or Pascal definition (which is shown to be an unfortunate choice) or based on division by truncation (T-definition) or division by flooring as defined by Knuth (F-definition). The differences between various definitions that are in common usage are discussed, and an additional one is proposed, which is based on Euclid’s theorem and therefore is called the Euclidean definition (E-definition). Its distinguishing feature is that 0 <= D mod d < abs(d) irrespective of the signs of D and d. It is argued that the E- and F-definitions are superior to all other ones in regularity and useful mathematical properties and hence deserve serious consideration as the standard convention at the applications and language level. It is also shown that these definitions are the most suitable ones for describing number representation systems and the realization of arithmetic operations at the architecture and hardware level.\"_\r\n\r\nAn example of the difference between the T-definition and the E-definition is the calculation of -3 mod 5. The T-definition gives -3, whereas the E-definition gives 2.\r\n \r\nIt is suggested that the ```%``` operator uses the E-definition on the basis of compatibility with Rebol2 and the ```%%``` operator uses the T-definition.\r\n\r\nNote: Currently % follows the T-definition and // follows the E-definition.\r\n"},"comment":{"url":"https://api.github.com/repos/red/red/issues/comments/394964435","html_url":"https://github.com/red/red/issues/2433#issuecomment-394964435","issue_url":"https://api.github.com/repos/red/red/issues/2433","id":394964435,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NDk2NDQzNQ==","user":{"login":"endo64","id":840604,"node_id":"MDQ6VXNlcjg0MDYwNA==","avatar_url":"https://avatars1.githubusercontent.com/u/840604?v=4","gravatar_id":"","url":"https://api.github.com/users/endo64","html_url":"https://github.com/endo64","followers_url":"https://api.github.com/users/endo64/followers","following_url":"https://api.github.com/users/endo64/following{/other_user}","gists_url":"https://api.github.com/users/endo64/gists{/gist_id}","starred_url":"https://api.github.com/users/endo64/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/endo64/subscriptions","organizations_url":"https://api.github.com/users/endo64/orgs","repos_url":"https://api.github.com/users/endo64/repos","events_url":"https://api.github.com/users/endo64/events{/privacy}","received_events_url":"https://api.github.com/users/endo64/received_events","type":"User","site_admin":false},"created_at":"2018-06-06T07:10:23Z","updated_at":"2018-06-06T07:10:23Z","author_association":"CONTRIBUTOR","body":"Currently `%%` conflicts with file value: `>> %% ; *** Syntax Error: invalid file! at \"%\"`"}}
{"actor":{"display_login":"endo64"}}